/*
 * CloseErrorInputFilterStream.java
 *
 * Created on October 28, 2002, 5:22 PM
 *
 * Copyright (c) 2002 The General Electric Company
 */

package com.ge.healthcare.autosc.processor.shemjob.test;

import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Close Error Input Filter Stream.
 *  This input stream operates as normal except that it gets an IOException
 *   when it closes the input stream.
 *  It is useful for testing the close() and silentlyClose() methods correctly
 *   handle IOExceptions.
 *
 * @author Daniel S. Horwitz, Compuware Corp.
 *
 * @version AutoSC P5P6
 */
public class CloseErrorInputFilterStream extends FilterInputStream
{
    /**
     * Creates a CloseErrorInputFilterStream.
     *
     * @param aSourceStream The underlying input stream.
     */
    public CloseErrorInputFilterStream( InputStream aSourceStream )
    {
        super( aSourceStream );
    }

    /**
     * Closes this input stream and releases any system resources associated
     *  with the stream.
     *
     * @exception IOException If an I/O error occurs.
     */
    public void close() throws IOException
    {
        super.close();
        throw new IOException( "Test I/O Close Error" );
    }
}
